home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / lkbackup.zip / ntmem.h < prev    next >
C/C++ Source or Header  |  1993-09-25  |  868b  |  26 lines

  1. // some memory function
  2. //
  3. // This is for the memory functions swiped from PERL...
  4.  
  5. #ifndef NTMEM_H
  6. #define NTMEM_H
  7.  
  8. #define FLUSH   ;fflush( stderr )
  9. #define Nullch  (char*)0
  10. #define New(x,v,n,t)  (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t))))
  11. #define Newc(x,v,n,t,c)  (v = (c*)safemalloc(((unsigned long)(n) * sizeof(t))))
  12. #define Newz(x,v,n,t) (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t)))), \
  13.     memzero((char*)(v), (n) * sizeof(t))
  14. #define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  15. #define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  16.  
  17. #define Safefree(d) safefree((char*)d)
  18. #define Str_new(x,len) str_new(len)
  19.  
  20. char    *safemalloc(size_t);
  21. char    *saferealloc(char *, size_t);
  22. void    safefree(char *);
  23. void    *memzero(char *, size_t);
  24.  
  25. #endif NTMEM_H
  26.